home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1984-04-24 | 1.8 KB | 47 lines |
- 10 'FILE NAMED TEST1.BAS WHAT IS THE REAL FILE CHARACTERISTICS..?????
- 15 'CONTRIBUTED BY RICH SCHINNELL.
- 20 CLS:CLOSE:KEY OFF
- 30 DEFINT A-Z:FALSE=0:TRUE=NOT FALSE
- 40 ON ERROR GOTO 370
- 42 PRINT "THIS PROGRAM WILL READ A FILE WHICH YOU SUSPECT MIGHT HAVE
- 43 PRINT "GARBAGE IN IT, ie Tabs or NULLs or something like that.
- 44 PRINT "It will print you the ascii/hex and the real ascii equivalents of
- 45 PRINT "what is in your file. a Q will end once you have
- 46 PRINT "started the program. Ctrl+PrtSc to print on printer ":PRINT
- 50 INPUT "What is the name of your file you want to check? ";INRICH$
- 60 D$=" 1 2 3 4 5 6 7"
- 70 C$="1234567890123456789012345678901234567890123456789012345678901234567890123456789"
- 80 IF LEN(INRICH$)<1 THEN 400
- 90 OPEN INRICH$ FOR INPUT AS #1
- 100 LINE INPUT #1,A$:F$="":G$="":H$="":J$="":K$="":INRICH$=LEFT$(INRICH$,80)
- 110 CLS:CNT=CNT+1
- 120 LOCATE 25,1:PRINT "Press Q to Stop, any other Key to continue":LOCATE 1,1
- 130 PRINT "Actual printing positions for the first 79 characters of line";CNT
- 140 PRINT:PRINT D$:PRINT C$
- 150 COLOR 0,7:PRINT A$:COLOR 7,0
- 160 PRINT "ASCII equivalents for each character":PRINT
- 170 FOR I=1 TO LEN(A$)
- 180 E$=STR$(ASC(MID$(A$,I,1)))
- 190 W$=HEX$(ASC(MID$(A$,I,1))):IF LEN(W$)<2 THEN W$="0"+W$
- 200 J$=J$+LEFT$(W$,1):K$=K$+RIGHT$(W$,1)
- 210 IF LEN(E$)>3 THEN F$=F$+MID$(E$,2,1) ELSE F$=F$+"0"
- 220 IF LEN(E$)>3 THEN G$=G$+MID$(E$,3,1) ELSE G$=G$+MID$(E$,2,1)
- 230 H$=H$+RIGHT$(E$,1)
- 240 NEXT I
- 250 COLOR 0,7:PRINT F$:PRINT G$:PRINT H$:COLOR 7,0
- 260 PRINT:PRINT" The HEXADECIMAL Values of your characters are:"
- 270 COLOR 0,7:PRINT J$:PRINT K$:COLOR 7,0
- 280 PRINT:PRINT "length of your line is";LEN(A$):PRINT "this is what is actually in your file":COLOR 0,7
- 290 FOR I=1 TO LEN(H$)
- 300 J$=MID$(F$,I,1)+MID$(G$,I,1)+MID$(H$,I,1)
- 310 PRINT CHR$(VAL(J$));
- 320 NEXT I:COLOR 7,0
- 330 PRINT:PRINT:BEEP
- 340 B$=INKEY$:IF B$="" THEN 340
- 350 IF B$="Q" OR B$="q" THEN CLOSE:CLS:KEY ON:END
- 360 GOTO 100
- 370 ' error trapping
- 380 IF ERL=90 THEN PRINT "bumb file name":RESUME 50
- 390 PRINT "error #";ERR;" has occured in line ";ERL
- 400 KEY ON:CLOSE:END
-